package org.csu.jpetstorespringversion.controller;

import org.csu.jpetstorespringversion.model.Category;
import org.csu.jpetstorespringversion.service.CategoryService;
import org.csu.jpetstorespringversion.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@RestController
@RequestMapping("product")
public class ViewProductController {
    @Autowired
    private ProductService productService;

    @GetMapping("index")
    public ModelAndView mainShow(@RequestParam("productid") String productid,Model model){
        model.addAttribute("productid",productid);
        return new ModelAndView("catalog/Product");
    }
}
